#ifndef __M_MSG_H__
#define __M_MSG_H__

#include "level.hpp"
#include "util.hpp"
#include <iostream>
#include <memory>
#include <thread>
#include <time.h>
using namespace std;

//日志消息类
struct LogMsg
{
    using ptr = shared_ptr<LogMsg>;
    size_t _line;//行号
    time_t _ctime;//时间
    thread::id _tid;//线程ID
    string _name;//日志器名称
    string _file;//文件名
    string _payload;//日志消息
    LogLevel::value _level;//日志等级
    LogMsg() {}
    LogMsg(string name,
           string file,
           size_t line,
           string payload,
           LogLevel::value level)
        : _name(name), _file(file), _payload(payload), _level(level), _line(line), _ctime(log_util::date::now()), _tid(std::this_thread::get_id()) {}
};

#endif